/**
 * <pre>
 * Title: 		SequenceService.java
 * Author:		linriqing
 * Create:	 	2009-7-25 下午02:33:55
 * Copyright: 	Copyright (c) 2009
 * Company:		Shenzhen Helper
 * <pre>
 */
package com.hengpeng.common.sequence;

/**
 * <pre>
 * 流水号服务接口
 * <code>
 * long startSequence = SequenceServiceImpl.getInstance().getSequence("TestSequence", 10);
 * </code>
 * </pre>
 * @author linriqing
 * @version 1.0, 2009-7-25
 */
public interface SequenceService
{
	public static final String CONTEXT_BEAN_NAME_SEQUENCESERVICE = "sequenceService";
	
	/**
	 * <pre>
	 * 根据流水号名称获取一个流水号
	 * </pre>
	 * @param sequenceName 流水号名称
	 * @return
	 */
	long getSequence(String sequenceName);
	
	/**
	 * <pre>
	 * 获取一批流水号
	 * </pre>
	 * @param sequenceName 流水号名称
	 * @param sequenceCount 流水号个数
	 * @return 该批流水号初始值
	 */
	public long getSequence(String sequenceName, long sequenceCount);

	/**
	 * <pre>
	 * 获取一批流水号
	 * </pre>
	 * @param sequenceName 流水号名称
	 * @param sequenceCount 流水号个数
	 * @param modMaxNum 流水号最大允许的计数，达到改数后从1开始循环
	 * @return 该批流水号初始值
	 */
	public long getSequence(String sequenceName, long sequenceCount, Long modMaxNum);
}
